<?php


$s = $_GET['s']??'';
//获取当前文件所在的绝对目录
$dir =  dirname(__FILE__)."/files".(($s)?('/'.$s):'');



$files = scandir($dir);
foreach($files as $i => $oldname){
	if(in_array($oldname,['.','..'])){
        unset($files[$i]);
    }
}
$files = array_values($files);

//print_r($files);

echo json_encode($files,JSON_UNESCAPED_UNICODE);
